<h1><%= _('Projects') %></h1>

<table>
  <thead>
  <tr>
    <th><%= _('Name') %></th>
    <% if current_user.is_admin? %>
    <th><%= _('Group') %></th>
    <% end %>
    <th><%= _('Date updated') %></th>
  </tr>
  </thead>
  <tbody>
<% @projects.each do | project | %>
  <tr>
	<td><%= link_to project.name, :controller => 'bulletins', :action=> 'list', :project_name => project.name %></td>
	<% if current_user.is_admin? %>
    <td><%= project.project_group.name %></td>
    <% end %>
	<td><%= project.date_updated %></td>

    <td><%= link_to(image_tag("Show.png", :title=>_("Show Bulletins"), :border => 0, :alt => "show"),  :controller => 'bulletins', :action => 'list', :project_name => project.name) %></td>
    <td><%= link_to(image_tag("edit.png", :title=>_("Edit"), :border => 0), :controller => 'projects', :action => 'edit', :project_name => project.name) %></td>
  	<td><%= link_to(image_tag("templates.png", :title=>_("Templates"), :border => 0),  :controller => 'templets', :project_name => project.name) %></td> 
   	<td><%= link_to(image_tag("users.png", :title=>_("Users"), :border => 0), :controller => 'user_roles', :project_name => project.name) %></td>
    <td><%= link_to(image_tag("destroy.png", :title=>_("Destroy"), :border => 0), {:controller => 'projects', :action => 'destroy', :id => project.id }, :confirm => _('Are you sure?'), :method => :post) %></td>
  </tr>
<% end %>
  </tbody>
</table>


<%= will_paginate @projects %>

<br/>
<hr />
<%= link_to(image_tag("add.png", :border => 0, :alt => _("New project"))+" "+_('New Project'), :controller => '/admin/projects', :action => 'new') %>
<% if current_user.is_admin? %> 
 | <%= link_to 'Project Groups', :controller => 'project_groups', :action => 'list' %>
<% end %>

<br />
